<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />		
		<meta name="author" content="" />
		<meta name="last-edit" content="2023.03.02" />
		<title>BOM</title>
		<style type="text/css">

			
		</style>

		<body>
      <p>当前时间：<span id="now" style="color: red; font-size: 20px;"></span></p>

      <ul>
        <li class="cla1">1</li>
        <li class="cla2">2</li>
        <li class="cla3">3</li>
        <li class="cla4">4</li>
        <li class="cla5">5</li>
      </ul>

			<script type="text/javascript">
        var num1 = 12
        let num2 = 22
        const num3 = 32
        window.num4 = 42

        delete num1
        delete num2
        delete num3
        delete num4
        console.log(num1);
        console.log(num2);
        console.log(num3);
        console.log(window.num4);

        // 定时器
        let timeoutId = setTimeout(() => {
          console.log('我是一个只执行一次的定时器');
        }, 1500)
        console.log(timeoutId);

        let intervalId = setInterval(() => {
          let date = new Date()
          let year = date.getFullYear()
          let month = date.getMonth() + 1
          let day = date.getDate()
          let hours = date.getHours()
          let minutes = date.getMinutes()
          let seconds = date.getSeconds()

          document.querySelector('#now').innerHTML = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
        }, 1000)
        console.log(intervalId);
        

        console.log(document.querySelector('#now').attributes);

        let ulEl = document.querySelector('ul')
        console.log(ulEl.innerHTML);
        ulEl.innerHTML += "<li class='cla6'>6</li>"

        let liEls = document.querySelectorAll('ul li')
        console.log(liEls);
        // document.querySelectorAll('ul li').forEach(function() {
        //   console.log(this);
        // })
			</script>
		</body>
	</head>

</html>